/**
 * 
 */
package com.revenco.bi.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;

import com.revenco.bi.controller.basecontroller.AbstractUserAwareController;
import com.revenco.bi.model.TnChartBaseinfo;
import com.revenco.bi.service.TnChartBaseinfoService;

/**
 * @author LingJun
 * @version $Revision:1.0.0, 2014年1月21日 下午3:06:20 
 */
@Controller
public class TnChartBaseinfoController extends AbstractUserAwareController {
	@Autowired
	TnChartBaseinfoService tnChartBaseinfoService;
	
	@RequestMapping(value = "/getChartList")
	@ResponseBody
	public List<TnChartBaseinfo> getChartList() {
		return tnChartBaseinfoService.getChartList();
	}
	
	@RequestMapping(value = "/listCharts")
	@ResponseStatus(HttpStatus.OK)
	public String list(Model model) {
		List<TnChartBaseinfo> list = tnChartBaseinfoService.getChartList();
		model.addAttribute("list", list);
		return "/chart/list";
	}
}
